package entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import consts.GlobalConsts;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

//不返回将空字段null作为json返回
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class Reservation {
    public static final int STATUS_NOT_AUDITED = 0;
    public static final int STATUS_FAILED = 1;
    public static final int STATUS_PASSED = 2;
    private Integer id;
    private User user;
    private Classroom classroom;

    @DateTimeFormat(pattern = GlobalConsts.DATE_FORMAT_PATTERN)
    private Date time;
    @DateTimeFormat(pattern = GlobalConsts.DATE_FORMAT_PATTERN)
    private Date start_time;
    @DateTimeFormat(pattern = GlobalConsts.DATE_FORMAT_PATTERN)
    private Date end_time;
    private Integer status;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Classroom getclassroom() {
        return classroom;
    }

    public void setclassroom(Classroom classroom) {
        this.classroom = classroom;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Date getStart_time() {
        return start_time;
    }

    public void setStart_time(Date start_time) {
        this.start_time = start_time;
    }

    public Date getEnd_time() {
        return end_time;
    }

    public void setEnd_time(Date end_time) {
        this.end_time = end_time;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }



    @Override
    public String toString() {
        return "Reservation{" +
                "id=" + id +
                ", user=" + user +
                ", classroom=" + classroom +
                ", time=" + time +
                ", start_time=" + start_time +
                ", end_time=" + end_time +
                ", status=" + status +
                '}';
    }
}
